{ "swagger": "2.0", "info": { "description": "This is the API documentation for {{ cookiecutter.project_name }}.", "title": "{{ cookiecutter.project_name }} API", "contact": {}, "version": "1.0" }, "basePath": "/", "paths": { "/amenities/amenities-list": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this list the property amenities", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Merchant"], "summary": "this list the property amenities", "parameters": [ { "type": "integer", "description": "Page ID (min 1)", "name": "page_id", "in": "query", "required": true }, { "type": "integer", "description": "Page size (1-50)", "name": "page_size", "in": "query", "required": true } ], "responses": {} } }, "/amenities/create": { "post": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this creates the property amenities", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Amenities"], "summary": "this creates the property amenities", "parameters": [ { "description": "Create amenities", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.AmenitiesReq" } } ], "responses": {} } }, "/amenities/delete": { "delete": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this deletes the property amenities", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Amenities"], "summary": "this deletes the property amenities", "parameters": [ { "type": "string", "description": "Amenity UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/amenities/get-amenities": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "get list the property amenities", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Amenities"], "summary": "the property amenities", "parameters": [ { "type": "string", "description": "Amenity UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/amenities/update": { "patch": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this updates the property amenities", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Amenities"], "summary": "this updates the property amenities", "parameters": [ { "description": "Create amenities", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.UpdateAmenitiesReq" } }, { "type": "string", "description": "Amenity UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/auth/create-account": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Register a user account using email", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Auth"], "summary": "Create a new user", "parameters": [ { "description": "User account", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.CreateUserRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/server.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/auth/login-account": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "login a user account using email", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Auth"], "summary": "login user with email", "parameters": [ { "description": "user login", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.loginUserEmailRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/server.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/auth/refresh-token": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "refresh the auth token", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Auth"], "summary": "refresh token", "parameters": [ { "description": "Refresh Token", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.renewAccessTokenRequest" } } ], "responses": {} } }, "/auth/reset-password": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "change the user password", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Auth"], "summary": "change user password", "parameters": [ { "description": "reset user password", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.ResetPasswordReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/server.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/bank-details/create": { "post": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this creates the user bank details", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Bank Details"], "summary": "this creates the user bank details", "parameters": [ { "description": "Create user bank details", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.BankDetailsReq" } } ], "responses": {} } }, "/bank-details/delete": { "delete": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this deletes the Bank Details", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Bank Details"], "summary": "this deletes the Bank Details", "parameters": [ { "type": "string", "description": "bank detail UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/bank-details/get/{id}": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "get list the user bank details", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Bank Details"], "summary": "the user bank details", "parameters": [ { "type": "string", "description": "Bank Detail ID UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/bank-details/list": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this list the Bank details", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Bank Details"], "summary": "this list the Bank details", "parameters": [ { "type": "integer", "description": "Page ID (min 1)", "name": "page_id", "in": "query", "required": true }, { "type": "integer", "description": "Page size (1-50)", "name": "page_size", "in": "query", "required": true } ], "responses": {} } }, "/booking/create": { "post": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this creates booking record for the user", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Booking"], "summary": "this creates booking record", "parameters": [ { "description": "Create booking", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.BookingReqMap" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/server.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/booking/get": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "get list get the booking records", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Booking"], "summary": "get the booking records", "parameters": [ { "type": "integer", "description": "Page ID (min 1)", "name": "page_id", "in": "query", "required": true }, { "type": "integer", "description": "Page Size (1-50)", "name": "page_size", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/server.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/category/category-list": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this list the property category", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Merchant"], "summary": "this list the property category", "parameters": [ { "type": "integer", "description": "Page ID (min 1)", "name": "page_id", "in": "query", "required": true }, { "type": "integer", "description": "Page size (1-50)", "name": "page_size", "in": "query", "required": true } ], "responses": {} } }, "/category/create": { "post": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this creates the property category", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Category"], "summary": "this creates the property category", "parameters": [ { "description": "Create category", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.CategoryReq" } } ], "responses": {} } }, "/category/delete": { "delete": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this deletes the property category", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Category"], "summary": "this deletes the property category", "parameters": [ { "type": "string", "description": "category UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/category/get-category": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "get list the property category", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Category"], "summary": "the property category", "parameters": [ { "type": "string", "description": "Category UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/category/update": { "patch": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this updates the property category", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Category"], "summary": "this updates the property category", "parameters": [ { "description": "Create category", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.UpdateCategoryReq" } }, { "type": "string", "description": "category UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/conversations/list": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this returns list of conversations for the user", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Connversation"], "summary": "this returns list of conversations for the user", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/server.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/conversations/{id}/{type}": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this returns the conversations between user and merchant", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Connversation"], "summary": "this returns the conversations between user and merchant", "parameters": [ { "type": "string", "description": "conversation UUID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "conversation type (chat or negotiation)", "name": "type", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/server.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/otp/send-otp": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Sends OTP via Email, SMS or WhatsApp", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["KYC"], "summary": "Send OTP for email or phone verification", "parameters": [ { "description": "KYC identifier", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.OTPRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/server.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/otp/verify-otp": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "verify otp sent to the email or phone number", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["KYC"], "summary": "verify otp sent to the users email or phone number", "parameters": [ { "description": "OTP verification", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.VerifyTokenRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/server.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/payments/all-transactions": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "get list get the booking records", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Payments"], "summary": "get the booking records", "parameters": [ { "type": "integer", "description": "Cursor ID (last payment record ID)", "name": "page_id", "in": "query" }, { "type": "integer", "description": "Page Size (1-50)", "name": "page_size", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/server.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/payments/verify": { "post": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this verifies a payment using the payment reference", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Payments"], "summary": "this verifies a payment using the payment reference", "parameters": [ { "description": "Verify payment", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.VerifyPaymentReq" } } ], "responses": {} } }, "/payments/withdraw-request": { "post": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this allows property owners to withdraw funds from their wallet", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Payments"], "summary": "this allows property owners to withdraw funds from their wallet", "parameters": [ { "description": "Withdraw funds", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.WithdrawalReq" } } ], "responses": {} } }, "/property-bookmarked/create": { "post": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this creates the property bookmark", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Property Bookmark"], "summary": "this creates the property bookmark", "parameters": [ { "description": "Create bookmark", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.BookMarkedReq" } } ], "responses": {} } }, "/property-bookmarked/delete": { "delete": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this deletes the property bookmark", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Property Bookmark"], "summary": "this deletes the property bookmark", "parameters": [ { "type": "string", "description": "bookmark UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/property-bookmarked/get/{id}": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "get list the property GetPropertyBookmarked", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Property Bookmark"], "summary": "the property GetPropertyBookmarked", "parameters": [ { "type": "string", "description": "Property ID UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/property-bookmarked/list": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this list the property bookmarked", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Property Bookmark"], "summary": "this list the property bookmarked", "parameters": [ { "type": "integer", "description": "Page ID (min 1)", "name": "page_id", "in": "query", "required": true }, { "type": "integer", "description": "Page size (1-50)", "name": "page_size", "in": "query", "required": true } ], "responses": {} } }, "/property/create": { "post": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "Upload property data", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Property"], "summary": "Create property", "parameters": [ { "description": "Create Property", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.CreatePropertyReq" } } ], "responses": {} } }, "/property/delete/{id}": { "delete": { "security": [ { "BearerAuth": [] }, { "ApiKeyAuth": [] } ], "description": "Remove a property and all related data", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Property"], "summary": "Delete property", "parameters": [ { "type": "string", "description": "Property UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/property/get-owner-property/{id}": { "get": { "security": [ { "BearerAuth": [] }, { "ApiKeyAuth": [] } ], "description": "Fetch property and all related arrays", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Property"], "summary": "Get single property", "parameters": [ { "type": "string", "description": "Property UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/property/get-property/{id}": { "get": { "security": [ { "BearerAuth": [] }, { "ApiKeyAuth": [] } ], "description": "Fetch property and all related arrays", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Property"], "summary": "Get single property", "parameters": [ { "type": "string", "description": "Property UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/property/property-list": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "Filter properties using any fields (category, city, country, etc.)", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Merchant"], "summary": "List all properties with filters", "parameters": [ { "type": "integer", "description": "Cursor ID (last property ID)", "name": "page_id", "in": "query" }, { "type": "integer", "description": "Page Size (1-50)", "name": "page_size", "in": "query", "required": true }, { "type": "string", "description": "Search property name", "name": "search", "in": "query" }, { "type": "integer", "description": "Minimum Price", "name": "min_price", "in": "query" }, { "type": "integer", "description": "Maximum Price", "name": "max_price", "in": "query" }, { "type": "string", "description": "Category ID", "name": "category", "in": "query" }, { "type": "string", "description": "Amenity ID", "name": "amenity", "in": "query" } ], "responses": {} } }, "/property/property-owner-list": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "Filter properties using any fields (category, city, country, etc.)", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Property"], "summary": "List all properties with filters", "parameters": [ { "type": "integer", "description": "Cursor ID (last property ID)", "name": "page_id", "in": "query" }, { "type": "integer", "description": "Page Size (1-50)", "name": "page_size", "in": "query", "required": true }, { "type": "string", "description": "Status", "name": "status", "in": "query" } ], "responses": {} } }, "/property/update/{id}": { "put": { "security": [ { "BearerAuth": [] }, { "ApiKeyAuth": [] } ], "description": "Update property details \u0026 related arrays", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Property"], "summary": "Update property", "parameters": [ { "type": "string", "description": "Property UUID", "name": "id", "in": "path", "required": true }, { "description": "update Property", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.UpdatePropertyReq" } } ], "responses": {} } }, "/reviews": { "post": { "security": [ { "BearerAuth": [] }, { "ApiKeyAuth": [] } ], "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Reviews"], "summary": "Create property review", "parameters": [ { "description": "Review data", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.CreateReviewRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/db.PropertyReview" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/reviews/list": { "get": { "security": [ { "BearerAuth": [] }, { "ApiKeyAuth": [] } ], "produces": ["application/json"], "tags": ["Reviews"], "summary": "List property reviews", "parameters": [ { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/db.PropertyReview" } } } } } }, "/reviews/{id}": { "get": { "security": [ { "BearerAuth": [] }, { "ApiKeyAuth": [] } ], "produces": ["application/json"], "tags": ["Reviews"], "summary": "Get property review", "parameters": [ { "type": "string", "description": "Review ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/db.PropertyReview" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] }, { "ApiKeyAuth": [] } ], "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Reviews"], "summary": "Update property review", "parameters": [ { "type": "string", "description": "Review ID", "name": "id", "in": "path", "required": true }, { "description": "Review data", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.UpdateReviewRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/db.PropertyReview" } } } }, "delete": { "security": [ { "BearerAuth": [] }, { "ApiKeyAuth": [] } ], "tags": ["Reviews"], "summary": "Delete property review", "parameters": [ { "type": "string", "description": "Review ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" } } } }, "/safety-items": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "get list the property safety items", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["SafetyItems"], "summary": "the property safety items", "parameters": [ { "type": "string", "description": "safety item UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/safety-items/create": { "post": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this creates the property safety items", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["SafetyItems"], "summary": "this creates the property safety items", "parameters": [ { "description": "Create safety items", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.SafetyItemsReq" } } ], "responses": {} } }, "/safety-items/delete": { "delete": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this deletes the property safety items", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["SafetyItems"], "summary": "this deletes the property safety items", "parameters": [ { "type": "string", "description": "Property UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/safety-items/safety-items-list": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this list the property safety items", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Merchant"], "summary": "this list the property safety items", "parameters": [ { "type": "integer", "description": "Page ID (min 1)", "name": "page_id", "in": "query", "required": true }, { "type": "integer", "description": "Page size (1-50)", "name": "page_size", "in": "query", "required": true } ], "responses": {} } }, "/safety-items/update": { "patch": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "this updates the property safety items", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["SafetyItems"], "summary": "this updates the property safety items", "parameters": [ { "description": "Create safety items", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.UpdateSafetyItemsReq" } }, { "type": "string", "description": "safety item UUID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/user/change-password": { "post": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "change the user password", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Auth"], "summary": "change user password", "parameters": [ { "description": "reset user password", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.ChangePasswordReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/server.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/user/edit-account": { "patch": { "security": [ { "BearerAuth": [] }, { "ApiKeyAuth": [] } ], "description": "edit the user profile", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Auth"], "summary": "edit the user profile", "parameters": [ { "description": "Edit the user", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.EditUserReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/server.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/user/get-account": { "get": { "security": [ { "ApiKeyAuth": [] }, { "BearerAuth": [] } ], "description": "get the user profile", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Auth"], "summary": "get the user account", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/server.SuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/ws/chat": { "get": { "description": "This WebSocket endpoint is used to **start and continue a real-time chat**\nbetween a **user (personal account)** and a **merchant**.\n\n---\nAuthentication\n- This endpoint requires authentication.\n- The authenticated user is resolved from the `Authorization` header.\n- The role (user or merchant) is determined automatically from the account type.\n\n---\nConversation Resolution\n- A chat is always between **one user and one merchant**.\n- The `merchant_id` query parameter represents the **peer you want to chat with**.\n- If the authenticated account is a **user**, `merchant_id` must be the merchant’s user ID.\n- If the authenticated account is a **merchant**, `merchant_id` must be the user’s ID.\n\n- The server automatically:\n1. Finds an existing conversation between the two parties, or\n2. Creates a new conversation if none exists.\n\n---\nWebSocket Connection Flow\n1. Client connects using:\n`ws:// @Description\u003chost\u003e/ws/chat?merchant_id=\u003cpeer_uuid\u003e`\n2. Connection is upgraded to WebSocket (HTTP 101).\n3. Messages sent by either party are:\n- Saved to the database\n- Broadcast in real-time to **both user and merchant**\n\n---\nSending Messages\nClients send JSON payloads in this format:\n\n```json\n\n{\n\"content\": \"Hello, I’m interested in this property\",\n\"property_id\": \"uuid-of-related-property\",\n\"reply_to_message_id\": \"optional-message-uuid\"\n}\n\n```\n\nField descriptions:\n- `content` (required): The message text.\n- `property_id` (required): The property this chat or negotiation relates to.\n- `reply_to_message_id` (optional): Used when replying to a specific message\n(must reference an existing message ID in the same conversation).\n\n---\nReceiving Messages\n- Messages received from the socket are broadcast events.\n- Each message includes sender info, timestamps, and reply relationships.\n- Both parties receive all messages in the conversation in real time.\n\n---\nError Handling\n- Invalid UUIDs, missing parameters, or auth failures return structured JSON errors.\n- If the socket disconnects, the conversation remains intact and can be resumed.\n\n---\nUse Cases\n- User messaging a merchant about a property\n- Merchant replying to user inquiries\n- Negotiation chat flows\n- Property-specific conversations\n", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Ws"], "summary": "Message a merchant or user (WebSocket chat)", "parameters": [ { "type": "string", "description": "Access token", "name": "access_token", "in": "query", "required": true }, { "type": "string", "description": "Peer ID (Merchant ID if user is logged in, User ID if merchant is logged in)", "name": "merchant_id", "in": "query", "required": true }, { "description": "Chat message payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.ChatReq" } } ], "responses": { "101": { "description": "Switching Protocols", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } }, "/ws/negotiation": { "get": { "description": "Opens a WebSocket connection for live negotiation.\nNegotiation WebSocket Flow\nThis WebSocket allows users and merchants to negotiate pricing in real time.\n---\n### Authentication\n- Requires JWT via `Authorization` header\n---\n### Connection URL\n```\nws://host/ws/negotiation?peer_id=\u003cUUID\u003e\n```\n- Users pass merchant ID\n- Merchants pass user ID\n---\n### Message Payload\n```json\n\n{\n\"amount\": 45000,\n\"property_id\": \"property-uuid\",\n\"is_accepted\": false\n}\n\n```\n---\n### Acceptance Flow\n- When `is_accepted = true`:\n- Booking is created\n- Wallet balances updated\n- Both sockets are disconnected\n\n---\n### Broadcast\n- Every negotiation update is broadcast to both parties\n\n---\n### Disconnect\n- Connection closes automatically when negotiation is completed", "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Ws"], "summary": "Negotiate pricing with a merchant (WebSocket)", "parameters": [ { "type": "string", "description": "Access token", "name": "access_token", "in": "query", "required": true }, { "type": "string", "description": "Merchant ID or User ID (UUID)", "name": "peer_id", "in": "query", "required": true }, { "description": "Negotiation message payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/server.NegotiateReq" } } ], "responses": { "101": { "description": "Switching Protocols", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/server.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/server.ErrorResponse" } } } } } }, "definitions": { "db.PropertyReview": { "type": "object", "properties": { "comment": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "property": { "type": "string" }, "rating": { "type": "integer" }, "updated_at": { "type": "string" }, "user": { "type": "string" } } }, "server.AmenitiesReq": { "type": "object", "required": ["amenity"], "properties": { "amenity": { "type": "string" } } }, "server.BankDetailsReq": { "type": "object", "required": ["property_id"], "properties": { "account_name": { "type": "string", "example": "John Doe" }, "bank_name": { "type": "string", "example": "First Bank" }, "property_id": { "type": "integer", "example": 2932022230 } } }, "server.BookMarkedReq": { "type": "object", "required": ["property_id"], "properties": { "property_id": { "type": "string", "example": "341e8c11-bdeb-41b7-84f5-6b96c0d99e02" } } }, "server.BookingReqMap": { "type": "object", "required": ["check_in", "check_out", "number_of_people", "property_id"], "properties": { "check_in": { "type": "string", "example": "1733875200000" }, "check_out": { "type": "string", "example": "1733875200000" }, "number_of_people": { "type": "integer", "example": 3 }, "property_id": { "type": "string", "example": "341e8c11-bdeb-41b7-84f5-6b96c0d99e02" } } }, "server.CategoryReq": { "type": "object", "required": ["category"], "properties": { "category": { "type": "string" } } }, "server.ChangePasswordReq": { "type": "object", "required": ["old_password", "password"], "properties": { "old_password": { "type": "string", "example": "myOLDpass123" }, "password": { "type": "string", "minLength": 6, "example": "myNewpass123" } } }, "server.ChatReq": { "type": "object", "properties": { "content": { "type": "string" }, "property_id": { "type": "string" }, "reply_to_message_id": { "type": "string" } } }, "server.CreatePropertyReq": { "type": "object", "required": [ "amenities", "amount", "category", "city", "country", "description", "description_title", "house_number", "images", "negotiable", "property_name", "rooms", "safety_item", "status", "street_address", "toilet", "zip_code" ], "properties": { "amenities": { "type": "array", "items": { "type": "string" } }, "amount": { "type": "integer" }, "bq": { "type": "integer" }, "category": { "type": "string" }, "city": { "type": "string" }, "country": { "type": "string" }, "description": { "type": "string" }, "description_title": { "type": "string" }, "ground_rule": { "type": "array", "items": { "type": "string" } }, "house_number": { "type": "string" }, "images": { "type": "array", "items": { "type": "string" } }, "living_room": { "type": "integer" }, "negotiable": { "type": "boolean" }, "property_name": { "type": "string" }, "rooms": { "type": "integer" }, "safety_item": { "type": "array", "items": { "type": "string" } }, "status": { "type": "string" }, "street_address": { "type": "string" }, "toilet": { "type": "integer" }, "zip_code": { "type": "string" } } }, "server.CreateReviewRequest": { "type": "object", "required": ["comment", "property_id", "rating"], "properties": { "comment": { "type": "string" }, "property_id": { "type": "string" }, "rating": { "type": "integer", "maximum": 5, "minimum": 1 } } }, "server.CreateUserRequest": { "type": "object", "required": [ "account_type", "email", "first_name", "last_name", "password" ], "properties": { "account_type": { "type": "string", "enum": ["personal", "merchant"] }, "email": { "type": "string" }, "first_name": { "type": "string", "minLength": 2 }, "last_name": { "type": "string", "minLength": 2 }, "password": { "type": "string", "minLength": 6 }, "phone_number": { "type": "string" } } }, "server.EditUserReq": { "type": "object", "properties": { "address": { "type": "string" }, "allow_notification": { "type": "boolean" }, "first_name": { "type": "string" }, "last_name": { "type": "string" }, "phone_number": { "type": "string" }, "profile_image": { "type": "string" }, "share_location": { "type": "boolean" }, "state": { "type": "string" } } }, "server.ErrorResponse": { "type": "object", "properties": { "code": { "type": "integer", "example": 400 }, "message": { "type": "string", "example": "invalid request data" }, "status": { "type": "string", "example": "error" } } }, "server.NegotiateReq": { "type": "object", "required": ["check_in", "check_out", "number_of_people"], "properties": { "amount": { "type": "integer" }, "check_in": { "type": "string", "example": "1733875200000" }, "check_out": { "type": "string", "example": "1733875200000" }, "is_accepted": { "type": "boolean" }, "number_of_people": { "type": "integer", "example": 3 }, "property_id": { "type": "string" }, "reply_to_message_id": { "type": "string" } } }, "server.OTPRequest": { "type": "object", "required": ["identifier", "identifier_type", "verification_type"], "properties": { "identifier": { "type": "string", "example": "john@gmail.com or 234XXXXXX23" }, "identifier_type": { "type": "string", "enum": ["email", "sms", "whatsapp"], "example": "email or sms" }, "verification_type": { "type": "string", "enum": ["registration", "password_reset", "update_phonenumber"], "example": "registration or password_reset or update_phonenumber" } } }, "server.ResetPasswordReq": { "type": "object", "required": ["email", "password"], "properties": { "email": { "type": "string", "example": "test@test.com" }, "password": { "type": "string" } } }, "server.SafetyItemsReq": { "type": "object", "required": ["safety_items"], "properties": { "safety_items": { "type": "string" } } }, "server.SuccessResponse": { "type": "object", "properties": { "data": {}, "message": { "type": "string" }, "status": { "type": "boolean" } } }, "server.UpdateAmenitiesReq": { "type": "object", "required": ["amenities", "id"], "properties": { "amenities": { "type": "string" }, "id": { "type": "string", "minLength": 1 } } }, "server.UpdateCategoryReq": { "type": "object", "required": ["category", "id"], "properties": { "category": { "type": "string" }, "id": { "type": "string", "minLength": 1 } } }, "server.UpdatePropertyReq": { "type": "object", "required": ["id"], "properties": { "amenities": { "type": "array", "items": { "type": "string" } }, "amount": { "type": "integer" }, "bq": { "type": "integer" }, "category": { "type": "string" }, "city": { "type": "string" }, "country": { "type": "string" }, "description": { "type": "string" }, "description_title": { "type": "string" }, "ground_rule": { "type": "array", "items": { "type": "string" } }, "house_number": { "type": "string" }, "id": { "type": "string", "minLength": 1 }, "images": { "type": "array", "items": { "type": "string" } }, "living_room": { "type": "integer" }, "negotiable": { "type": "boolean" }, "property_name": { "type": "string" }, "rooms": { "type": "integer" }, "safety_item": { "type": "array", "items": { "type": "string" } }, "status": { "type": "string" }, "street_address": { "type": "string" }, "toilet": { "type": "integer" }, "zip_code": { "type": "string" } } }, "server.UpdateReviewRequest": { "type": "object", "required": ["comment", "property_id", "rating"], "properties": { "comment": { "type": "string" }, "property_id": { "type": "string" }, "rating": { "type": "integer", "maximum": 5, "minimum": 1 } } }, "server.UpdateSafetyItemsReq": { "type": "object", "required": ["id", "safety_items"], "properties": { "id": { "type": "string", "minLength": 1 }, "safety_items": { "type": "string" } } }, "server.VerifyPaymentReq": { "type": "object", "required": ["payment_provider", "payment_ref"], "properties": { "payment_provider": { "type": "string", "enum": ["flutterwave", "paystack"], "example": "flutterwave paystack" }, "payment_ref": { "type": "string" } } }, "server.VerifyTokenRequest": { "type": "object", "required": [ "identifier", "identifier_type", "token", "verification_type" ], "properties": { "identifier": { "type": "string", "example": "john@gmail.com or 234XXXXXX23" }, "identifier_type": { "type": "string", "enum": ["email", "sms", "whatsapp"], "example": "email or sms" }, "token": { "type": "string", "example": "0000" }, "verification_type": { "type": "string", "enum": ["registration", "password_reset", "update_phonenumber"], "example": "registration or password_reset or update_phonenumber" } } }, "server.WithdrawalReq": { "type": "object", "required": ["account_number_id", "amount"], "properties": { "account_number_id": { "type": "string" }, "amount": { "type": "integer" } } }, "server.loginUserEmailRequest": { "type": "object", "required": ["email", "password"], "properties": { "email": { "type": "string" }, "password": { "type": "string", "minLength": 6 } } }, "server.renewAccessTokenRequest": { "type": "object", "required": ["refresh_token"], "properties": { "refresh_token": { "type": "string" } } } }, "securityDefinitions": { "ApiKeyAuth": { "description": "Use your API key to authenticate requests.", "type": "apiKey", "name": "api-access-key", "in": "header" }, "BearerAuth": { "description": "Use `Bearer \u003ctoken\u003e` for authentication.", "type": "apiKey", "name": "Authorization", "in": "header" } } }